package com.example.mapp;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.example.entity.ImportRecord;

/**
 * Created by dou on 2018/10/15.
 */
@Mapper
public interface ImportRecordMapp {

	@Select(" select count(1) from import_record  where user_id=#{userId} and type=#{type} ")
	int findByIdList(ImportRecord importRecord) throws Exception;

	@Insert("insert into import_record (user_id,type,import_dt) values (#{userId},#{type},#{importDt})")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "id", keyColumn = "id", before = false, resultType = Long.class)
	int add(ImportRecord importRecord) throws Exception;
}
